package com.chushouya.controller.order.api;

import com.chushouya.common.constant.ServiceType;
import com.chushouya.order.dto.api.order.OrderQualityApiDTO;
import com.general.framework.core.schema.Response;
import com.chushouya.order.service.api.OrderQualityApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 订单质检API控制器
 * 提供质检相关的接口服务
 */
@Api(tags = ServiceType.API + "订单质检接口")
@RestController
@RequestMapping(ServiceType.API + "/order/quality")
@Slf4j
@Validated
public class OrderQualityApiController {

    @Resource
    private OrderQualityApiService orderQualityApiService;

    @ApiOperation("获取订单质检详情")
    @GetMapping("/detail")
    public Response<OrderQualityApiDTO> getQualityDetail(
            @ApiParam(value = "订单号", required = true) @RequestParam String orderNo) {
        OrderQualityApiDTO qualityDetail = orderQualityApiService.getQualityDetail(orderNo);
        return Response.success(qualityDetail);
            }
}
